home *** CD-ROM | disk | FTP | other *** search
- Path: news.cis.nctu.edu.tw!usenet
- From: terryt@mcs.com (Terry Trippany)
- Newsgroups: comp.lang.c++
- Subject: Re: How to use CEdit.GetLine
- Date: 9 Jan 1996 16:45:51 GMT
- Organization: STR/Baxter Labs
- Message-ID: <4cu63v$qta@news.cis.nctu.edu.tw>
- References: <960108.175553.3102@banshee.uunet.ca>
- NNTP-Posting-Host: @159.198.73.111
- Mime-Version: 1.0
- Content-Type: Text/Plain; charset=US-ASCII
- X-Newsreader: WinVN 0.99.7
-
- In article <960108.175553.3102@banshee.uunet.ca>, ffisl@travel-net.com says...
- >
- >Hi!
- >
- >Could anyone post a short example on how to use the CEdit.GetLine
- >function to retrieve a line from an edit control in a dialog box ad
- >convert the retrieved string to a number?
- >
- >Thanks, Frank
- >
-
-
- The GetLine function only works for multiline edit controls. It is very easy to use.
-
- Suppose you already have a CEdit control object set up
-
- CEdit editControl;
-
- you can simply do the following to retrieve a value from line 0:
- CString strEditBuf;
-
- editControl.GetLine(0, strEditBuf);
-
- // convert using atoi
- int i = atoi(strEditBuf)
-
- // you have to check the return values and such
-
- This should get you in the right direction.
-
- Terry
-
-